package com.macro.mall.tiny.modules.oms.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("oms_order_goods")
@Schema(description = "订单商品表")
public class OrderGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "order_goods_id", type = IdType.AUTO)
    @Schema(description = "订单商品主键id")
    private Integer orderGoodsId;

    @Schema(description = "订单编码", maxLength = 19)
    private String orderNo;

    @Schema(description = "顾客id")
    private Integer userId;

    @Schema(description = "产品id")
    private Integer skuId;

    @Schema(description = "个数")
    private Integer qty;

    @Schema(description = "商品备注")
    private String remark;

    @Schema(description = "商品编码")
    private String skuCode;

    @Schema(description = "标题")
    private String title;

    @Schema(description = "商品主图")
    private String mainImg;

    @Schema(description = "划线价")
    private BigDecimal crossedPrice;

    @Schema(description = "价格")
    private BigDecimal price;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    @Schema(description = "软删除：0-正常，1-已删除")
    @TableLogic
    private Integer delFlag;
}